function result = cal_std_normbymean_log(n,a)
    index=isnan(a);
    n(index)=[];
    a(index)=[];

%     n=n/sum(n);
    mean=sum(n.*a)/sum(n);
    a=a./mean;
    a=log(a);
    mean=sum(n.*a)/sum(n);
    
    result=0;
    for i=1:length(n)
        result=result+(a(i)-mean)^2*n(i)/sum(n);
    end
    result=result^0.5;
end